package com.huffman.smart_picture.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.huffman.smart_picture.domain.dto.picture.WaterfallQueryDto;
import com.huffman.smart_picture.domain.entity.Picture;
import com.huffman.smart_picture.domain.vo.pircture.PictureDetailVo;
import com.huffman.smart_picture.domain.vo.pircture.WaterfallPictureVo;
import org.apache.ibatis.annotations.Param;

import java.util.Map;

/**
 * @author LinDeng
 * @description 针对表【picture(图片)】的数据库操作Mapper
 * @createDate 2025-02-16 16:08:07
 * @Entity com.huffman.smart_picture.domain.entity.Picture
 */
public interface PictureMapper extends BaseMapper<Picture> {

    /**
     * 分页获取连表数据
     *
     * @param waterfallQueryDto
     * @param iPage
     * @return
     */
    Page<WaterfallPictureVo> pageQueryPictureVos(WaterfallQueryDto waterfallQueryDto, IPage<WaterfallPictureVo> iPage);


    PictureDetailVo queryPictureDetailVo(Long id);

    /**
     * 批量更新图片获赞数
     * @param pictureFavoriteCountMap (pictureId:favorite_count)
     */
    void batchUpdateFavoriteCount(@Param("pictureFavoriteCountMap") Map<Long, Integer> pictureFavoriteCountMap);
}




